package host

import "context"

const (
	PUT UpdateMode = iota
	PATCH
)

type UpdateMode int

type UpdateHostData struct {
	*Resource
	*Describe
}

type Service interface {
	SaveHost(context.Context,*Host)(*Host,error)
	QueryHost(context.Context, *QueryHostRequest) (*HostSet, error)
	UpdateHost(context.Context, *UpdateHostRequest) (*Host, error)
	DescribeHost(context.Context, *DescribeHostRequest) (*Host, error)
	DeleteHost(context.Context, *DeleteHostRequest) (*Host, error)
}

type QueryHostRequest struct {
	PageSize   uint64 `json:"page_size,omitempty"`
	PageNumber uint64 `json:"page_number,omitempty"`
}

type DeleteHostRequest struct {
	Id string `json:"id" validate:"required"`
}

type UpdateHostRequest struct {
	Id             string          `json:"id" validate:"required"`
	UpdateMode     UpdateMode      `json:"update_mode"`
	UpdateHostData *UpdateHostData `json:"data" validate:"required"`
}

type DescribeHostRequest struct {
	Id string `json:"id" validate:"required"`
}